<?php
/*
 * file : prompt
 * author: shuang
 * email : shuangbrother@126.com
 * created_at : 2015-12-15 -- 16:56:05
 */
use yii\bootstrap\Alert;
if (Yii::$app->getSession()->hasFlash('error')) {
    echo Alert::widget([
        'options' => [
            'class' => 'alert-warning', //这里是提示框的class
        ],
        'body' => Yii::$app->getSession()->getFlash('error'), //消息体
    ]);
}
?>
<?php $this->registerJs('var $div = $(".alert-success,.alert-warning");$div.animate({opacity: 0}, 2000, "swing", function () {$div.remove();});'); ?>